package ar.maikoova.varios;
import javax.swing.JFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Calendar;
import java.util.GregorianCalendar;

import javax.swing.LayoutStyle.ComponentPlacement;

import ar.maikoova.models.ClienteInversor;


@SuppressWarnings("serial")
public class Cornudo extends JFrame {

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
				@SuppressWarnings("unused")
				Cornudo prueba=new Cornudo();
		
	}

	/**
	 * Create the frame.
	 */
	public Cornudo() {
		setAlwaysOnTop(true);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setVisible(true);
		//setMaximizable(true);
		//setClosable(true);
		setTitle("Login Usuario");
		setSize(300, 486);
		
		JButton btnPrecionar = new JButton("Precionar");
		btnPrecionar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				javax.swing.JOptionPane.showMessageDialog(null, "Puto el que lee");
			}
		});
		
		JButton btnInsertarCliente = new JButton("Insertar CLiente");
		btnInsertarCliente.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Calendar fecha = new GregorianCalendar();
				@SuppressWarnings("deprecation")
				ClienteInversor cliente = new ClienteInversor(0, 0, "NombreCliente"+fecha.getTime(), 
						"ApellidoCliente"+fecha.getTime(), "Direccion"+fecha.getTime(),
						fecha.getTime().getSeconds(), 
						(fecha.getTime().getDay()+"/01/2014"),
						"Cuil"+fecha.getTime(),"Tel"+fecha.getTime());
				cliente.insert();
			}
		});
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(btnPrecionar, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
							.addGap(197))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(btnInsertarCliente)
							.addContainerGap(185, Short.MAX_VALUE))))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(btnPrecionar)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(btnInsertarCliente)
					.addContainerGap(385, Short.MAX_VALUE))
		);
		getContentPane().setLayout(groupLayout);
	
	}
}
